#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include<vector>
using namespace std;

int main() {
    static int m, n;
    cin >> n >> m;
    vector<long long> arr(n + 1, 0);
    vector<long long> d(n + 1, 0);
    int i = 0;
    for (i = 1; i <= n; i++) {
        scanf("%lld", &arr[i]);
    }
    for (i = 1; i <= n; i++) {
        d[i] = arr[i] - arr[i - 1];
    }
    while (m--) {
        int l, r, k;
        cin >> l >> r >> k;
        d[l] += k;
        if (r + 1 <= n) {
            d[r + l] -= k;
        }
    }

    for (i = 1; i <= n; i++) {
        arr[i] = arr[i - 1] + d[i];
    }
    for (i = 1; i <= n; i++) {
        printf("%lld ", arr[i]);
    }
    return 0;

}